package com.mall.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mall.pojo.PmsBrand;
import com.mall.db.api.PmsBrandApi;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PmsBrandService {

    @DubboReference
    private PmsBrandApi pmsBrandApi;

    //添加品牌
    public void create(PmsBrand pmsBrand) {
        pmsBrandApi.create(pmsBrand);
    }

    //删除品牌
    public void delete(Integer id) {
        pmsBrandApi.delete(id);
    }

    //更新品牌
    public void update(Integer id, PmsBrand pmsBrand) {
        pmsBrandApi.update(id, pmsBrand);
    }

    //根据编号查询品牌信息
    public PmsBrand selectById(Integer id) {
        return pmsBrandApi.selectById(id);
    }

    //批量删除品牌
    public void batch(List<Integer> ids) {
        pmsBrandApi.batch(ids);
    }

    //批量更新显示状态
    public void showStatus(List<Integer> ids, Integer showStatus) {
        pmsBrandApi.showStatus(ids,showStatus);
    }

    //批量更新厂家制造商状态
    public void factoryStatus(List<Integer> ids, Integer factoryStatus) {
        pmsBrandApi.factoryStatus(ids,factoryStatus);
    }

    //获取全部品牌列表
    public List<PmsBrand> listAll() {
        return pmsBrandApi.listAll();
    }

    //根据品牌名称分页获取品牌列表
    public Page<PmsBrand> list(Integer pageSize, Integer pageNum, String keyword) {
        return pmsBrandApi.list(pageNum,pageSize,keyword);
    }
}
